<template>
    <h2>显示用户列表</h2>
    <table>
        <thead>
            <tr>
                <td>用户编号</td>
                <td>用户名</td>
                <td>登录时间</td>
            </tr>
        </thead>
        <tbody>
            <tr v-for="i in data" :key="i.Uid">
                <td>{{ i.Uid }}</td>
                <td>{{ i.UserName }}</td>
                <td>{{ i.UTime.substr(0, 19).replace("T", " ") }}</td>
            </tr>
        </tbody>
    </table>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import axios from 'axios';
const data: any = ref([]);
onMounted(() => {
    show();
})
const show = () => {
    axios.get("http://localhost:50394/api/Regist/ShowLogin")
        .then(res => {
            data.value = res.data;
        })
        .catch(err => {
            console.log(err);
        })
}
</script>